import request from '@/util/request'

// 加载主分类
export function loadMainCategory(query) {
  return request({
    url: '/aqs/spuSearch/mainCate.json',
    method: 'post',
    data: query,
    baseURL: process.env.VUE_APP_AJS_INDEX
  })
}
// 加载子分类
export function loadsubCategory(query) {
  return request({
    url: '/aqs/spuSearch/childCate.json',
    method: 'post',
    data: query,
    baseURL: process.env.VUE_APP_AJS_INDEX
  })
}

// 加载关键属性
export function loadAttribute(childId) {
  return request({
    url: `/aqs/spuSearch/propVal/${childId}.json`,
    method: 'get',
    baseURL: process.env.VUE_APP_AJS_INDEX
  })
}
// 获取存在商品的属性值id
export function loadPropValExistSpu(propType, query) {
  return request({
    url: `/aqs/spuSearch/propValExistSpu/${propType}.json`,
    method: 'post',
    data: query,
    baseURL: process.env.VUE_APP_AJS_INDEX
  })
}
